Show AllShow All

AutoLayout Property

Returns or sets an MsoTriState constant which determines the automatic positioning of the nodes and connectors in a diagram. Read/write.

expression.AutoLayout

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

This example creates a diagram in the current document and automatically positions the nodes and connectors.

Sub CreatePyramidDiagram()
    Dim dgnNode As DiagramNode
    Dim shpDiagram As Shape
    Dim intCount As Integer

    Set shpDiagram = ActiveSheet.Shapes.AddDiagram( _
        Type:=msoDiagramPyramid, _
        Left:=10, _
        Top:=15, _
        Width:=400, _
        Height:=475)
    Set dgnNode = shpDiagram.DiagramNode.Children.AddNode

    For intCount = 1 To 3
        dgnNode.AddNode
    Next intCount

    With dgnNode.Diagram
        .AutoLayout = msoTrue
        .Convert Type:=msoDiagramRadial
    End With

End Sub